package com.spring.demo04;

import com.spring.demo2.UserService;
import com.spring.demo2.UserServiceImpl;

/**
 * @author:liuwei
 * @creatdate:2021-07-15-14:12
 */
public class Client {
	public static void main(String[] args) {
		//真是角色
		UserServiceImpl userService = new UserServiceImpl();
		//代理角色
		PorxyInvocationHandler porxyInvocationHandler = new PorxyInvocationHandler();
		//设置要代理的对象
		porxyInvocationHandler.setTarget(userService);
		//动态生成代理类
		UserService proxy = (UserService) porxyInvocationHandler.getProxy();
		proxy.add();
	}
}
